<?php
/****
 * 沧海登录
 *
 * @author: qingkuangs(qingkuangs@gmail.com)
 * @date  : 2011-05-04
 *
****/
include(dirname(__FILE__)."/global.php");
include(INCLUDE_PATH."/common/common.func.php");

if(isset($_POST["act"])) {
	$username		= $_POST["username"];
	$password		= $_POST["password"];
	
	$ip				= get_client_ip();
	$time			= date("YmdHis");
	$type			= 0;
	$strText		= "account=".$username."&pwd=".md5($password)."&type=".$type."&sex=0&ip=".$ip."&time=".$time."&from=qx&ad_source=guo1001&ad_pos=101";
	$passport_key	= "123456";

	$strAuth = base64_encode($strText);
	$strVerify = md5($strAuth.$passport_key);
	
	$rurl = "/daction.php?action=login&auth=".urlencode($strAuth)."&verify=".urlencode($strVerify)."";

	echo "<meta http-equiv=refresh content='0; url=".$rurl."'>";

	exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>九霄</title>
<script type="text/javascript" src="/js/prototype-1.4.0.js"></script>
<script type="text/javascript" src="/js/system.lib.js"></script>
<style type="text/css">
body {font-size:12px; margin:0px; padding:0px;background:url(images/bg.jpg) center center no-repeat; height:auto;}
img {border:0px;}
.Logging { margin:0px auto 70px auto; width:273px; height:97px; padding:209px 0px 0px 150px;background-image:url(images/logging.png);/**IE7,FF*/
_background:none;/*IE6*/
_filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='scale', src="images/logging.png");/*IE6*/ }
.Logging input.text {height:18px; border:1px solid #0c1113; background:#d5e0e5; width:206px;}
.Foot {width:1003px; height:36px; padding-top:53px; margin:0px auto;background-image:url(images/foot.png);/**IE7,FF*/
_background:none;/*IE6*/
_filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='scale', src="images/foot.png");/*IE6*/ }
</style>
</head>
<script language="javaScript">
function checkFrm() {
	if(document.getElementById("username").value == "") {
		alert("请填写通行证!");
		return false;
	}
	//if(document.getElementById("password").value == "") {
	//	alert("请填写密码!");
	//	return false;
	//}
	document.loginFrm.submit();
}
function resizeContent() {
	var winSize	= WDimension.getWSize();
	var wHeight	= winSize.height;
	var sHeight = WDimension.getScrollHeight();
	var wWidth  = winSize.width;
	var sWidth  = WDimension.getScrollWidth();
	
	var objMain = $("main");
	var objBody = $("body");
	if(objMain) {
		var bodyHeight			= getCurrentStyle(document.body,"height");
		var mainHeight			= parseInt(getCurrentStyle(objMain,"height"));
		var topHeight			= parseInt((wHeight - mainHeight) / 2);
		(topHeight < 0) ? topHeight = 10 : "";

		objBody.style.height	= wHeight + "px";
		objMain.style.top		= topHeight + "px";
		objMain.style.display	= "";
	}
}
function login(username,password){
	document.getElementById("username").value = username;
	document.getElementById("password").value = password;
	document.loginFrm.submit();

	return true;
}
function exit(){

	return true;
}
//Event.observe(window,"load",resizeContent,false);
//Event.observe(window,"resize",resizeContent,false);
</script>
<body>


<div id="body" name="body" style="width:1280px;height:669px">
	
		  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
					id="loginSwf" width="1280" height="669"
					codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
					<param name="movie" value="/images/login.swf" />
					<param name="quality" value="high" />
					<param name="bgcolor" value="#000000" />
					<param name="allowScriptAccess" value="always" />
					<param value="window" name="wmode" />
					<param name="FlashVars" value="playerId=&session=<? echo session_id(); ?>&<? echo time();?>" />
					<embed src="/images/login.swf" quality="high" bgcolor="#000000"
						width="100%" height="100%" name="loginSwf" align="middle"
						play="true"
						loop="false"
						quality="high"
						wmode="window"
						allowScriptAccess="always"
						type="application/x-shockwave-flash"
						pluginspage="http://www.adobe.com/go/getflashplayer">
					</embed>
			</object>
</div>
<div style="display:none">
<form id="loginFrm" name="loginFrm" method="post" action="/login_test.php" onsubmit="checkFrm();return false;">
<input type="hidden" id="act" name="act" value="login" />
		  <table width="100%" border="0" cellspacing="0" cellpadding="2">
			<tr>
			  <td><label>
				<input type="text" id="username" name="username" class="text"/>
			  </label></td>
			  </tr>
			<tr>
			  <td><input type="hidden" id="password" name="password" class="text"/></td>
			  </tr>
			<tr>
			  <td>
				<input type="image" src="images/btn_log.gif" />
			    <a href="#" onclick="alert('点登录自动创建');return false;"><img src="images/btn_reg.gif" width="86" height="27" border="0" /></a></td>
			  </tr>
		  </table>
</form>
</div>
</body>
</html>